<?php
use function \core\pplain;
?>
<html>
<head>
    <link href="/globalView/Bootstrup/bootstrap4/grid/grid.css" rel="stylesheet">
    <style>
        div{
            text-align: center;
        }

    </style>
</head>
<body>
<section class="jumbotron text-center">
    <div class="container">
        <h1>CAR&nbspLIST</h1>
        <h5><?php pplain($data)?>
            <div>
                <h1>COSTS:<?php echo $sum;?></h1>
            </div>
        </h5>
        <p class="lead text-muted">manager your goods here</p>
        <p>
            <a href="/run/MAPP/shop/index/index/page/0" class="btn btn-primary my-2">SHOPING</a>
            <a href="/run/MAPP/shop/car/mcar" class="btn btn-secondary my-2">SHOPING CAR</a>
        </p>
    </div>
</section>
<div style="width: 80%;margin: 0 auto">
    <form style="text-align: center" method="post" action="/run/MAPP/shop/buy/buyselect">
<?php
            foreach ($shop as $v){
                $id = $v["id"];
                $name = $v["name"];
                $num = $v["num"];
                $price = $v["price"];
                $costs = $v["costs"];
                $img = $v["img"];
                $d = <<<EOF
    <div class="row mb-3">
        <div class="col-md-8 themed-grid-col">
          <div class="pb-3">
            $name
          </div>
          <div class="row">
            <div class="col-md-6 themed-grid-col">num:$num</div>
            <div class="col-md-6 themed-grid-col">price:$price | costs:$costs</div>
          </div>
        </div>
        <div class="col-md-4 themed-grid-col">
            <img src="$img" style="width: 100%;height: 100px">
        </div>
        <div style="text-align: center;margin: 0 auto">
            <input type="checkbox" name="$id" value="$num" class="btn btn-primary my-2">
            <a style="margin-right: 1em" href="/run/MAPP/shop/car/car/id/$id" class="btn btn-primary my-2">ADD</a>
            <a style="margin-right: 1em" href="/run/MAPP/shop/car/dcar/id/$id" class="btn btn-secondary my-2">LESS</a>
            <a onclick="return confirm('DEL the id $id ?')" style="margin-right: 1em" href="/run/MAPP/shop/car/delc/id/$id" class="btn btn-secondary my-2">DEL</a>
        </div>
</div>
EOF;
echo $d;}
?>
        <input name="submit" type="submit" placeholder="BUY SELECT" class="btn btn-secondary my-2">
    </form>
    <?php echo "<a style='margin-bottom: 2em' href='/run/MAPP/shop/car/delcar' class=\"btn btn-secondary my-2\">clearn</a>";?>
    <?php echo "<a style='margin-bottom: 2em' href='/run/MAPP/shop/car/savecar' class=\"btn btn-secondary my-2\">SAVE CAR</a>";?>
    <?php echo "<a style='margin-bottom: 2em' href='/run/MAPP/shop/car/savecar' class=\"btn btn-secondary my-2\">BUY ALL</a>";?>
</div>
</body>
</html>
